Overriding profile endpoint with analyze endpoint with operator tree and profiling#5568
Open
Krish-Gandhi wants to merge 2 commits into
Open
Overriding profile endpoint with analyze endpoint with operator tree and profiling#5568Krish-Gandhi wants to merge 2 commits into
Krish-Gandhi wants to merge 2 commits into
Conversation
…and profiling Signed-off-by: Krish Gandhi <kjg2352@gmail.com>
Signed-off-by: Krish Gandhi <kjg2352@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
analyzeendpoint for PPL queries, which can be activated by passing"analyze": trueas a request body parameter.profileendpoint to runanalyzefunctionality.analyzeflag through transport and request parsing.operator_tree.operator_treenodes.profileplanresponse withoperator_treenodes to calculate time taken by each node.Important
This PR overrides the existing
profileendpoint by routing all requests with either"analyze": trueor"profile": true(or both) topplService.analyze()inTransportPPLQueryAction.java. For current end-users of theprofileendpoint, this will make little difference, as the response fromprofileis a subset of the response fromanalyze. In simpler terms, current end-users can make no changes and have similar results.All of the existing code for
profilestill exists and is in place. This makes it extremely simple to separateanalyzeandprofileagain. This can be done by removing theelseblock in lines 196-199 ofTransportPPLQueryAction.javaand replacing it with the commentedelse ifandelseblocks in lines 203-211.plugin/src/main/java/org/opensearch/sql/plugin/transport/TransportPPLQueryAction.java:193-215:Example Query and Response
The following
curlcommand will run the querysource=accounts | where age < 30 | eval full_name = firstname + \" \" + lastname | fields full_name, email, ageon theanalyzeendpoint:The response of this will be as follows. (NOTE: The
"logicalPlan"and"physicalPlan"fields are included for debugging purposes and should not be included in the final version of this endpoint.)Performance of
analyzeAfter writing a benchmarking script to run a query on a sample dataset, the results were as follows:
Related Issues
#5500
Resolves #4343
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.